cmake_minimum_required(VERSION 3.0)

set(EXAMPLE_NAME tinytiffreader_test)

add_executable(${EXAMPLE_NAME}
	tinytiffreader_test.cpp
)
if(TinyTIFF_BUILD_STATIC_LIBS)
    target_link_libraries(${EXAMPLE_NAME} TinyTIFF)
elseif(TinyTIFF_BUILD_SHARED_LIBS)
    target_link_libraries(${EXAMPLE_NAME} TinyTIFFShared)
endif()
target_link_libraries(${EXAMPLE_NAME} common_tinytiff_test_lib)

add_test(NAME ${EXAMPLE_NAME} COMMAND ${EXAMPLE_NAME} WORKING_DIRECTORY ${CMAKE_INSTALL_BINDIR})

# Installation
install(TARGETS ${EXAMPLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
#install(FILES ${CMAKE_CURRENT_LIST_DIR}/2K_source_Stack.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
#install(FILES ${CMAKE_CURRENT_LIST_DIR}/2K_tiff_image.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/cell.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/circuit.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/galaxy.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/mri.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/corel_photopaint_grey.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/corel_photopaint_grey16.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/corel_photopaint_greyalpha.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/corel_photopaint_rgb.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/corel_photopaint_rgb48.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/corel_photopaint_rgba.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/imagej_32bit_ramp_tiled.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/circuit_nocompression.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/galaxy_nocompression.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/mri_nocompression.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/multi-channel-time-series.ome.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/test16m_imagej.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_LIST_DIR}/imagej_32bit_ramp.tif DESTINATION ${CMAKE_INSTALL_BINDIR})
